<%-- 
  - Author: Neha Chauhan
  - Date: 03-Apr-'2011
  - Copyright Notice: TRAKHEES
  - Description: form.jsp
 --%>

<%@ include file="/WEB-INF/view/include.jsp"%>
<%@ page import="ae.pcfc.etks.online.web.*"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>



<script type="text/javascript">
	$()
			.ready(
					function() {

						//$("input:submit").button();

						$("#Login")
								.validate(
										{
											onfocusout : false,
											onkeyup : false,
											//onclick: false,			
											rules : {
												strUserName : "required",
												strPassword : "required"

											},
											showErrors : function(errorMap,
													errorList) {

												var errors = '<ul>';
												var label;
												if (errorList.length) {
													$.each(errorMap, function(
															name, value) {
														label = $(
																"label[for='"
																		+ name
																		+ "']")
																.html();
														label = value + '['
																+ label + ']';
														errors = errors
																+ '<li>'
																+ label
																+ '</li>';

													});
													errors = errors + '</ul>';
													jAlert('error', errors,
															'<spring:message code="label.errormessage" />');
												}
											}
										});

					});
</script>

<script type="text/javascript">
	/*$(function() {
	
	 $('.tooltip').showBalloon({}).toggle(
	 function(){ $(this).hideBalloon(); },
	 function(){ $(this).showBalloon(); }
	 );
	
	
	
	 }); 

	 $(function() {
	 $('.tooltipLeft').balloon({ position: "left", 
	 css: {
	
	 lineHeight: '3',		    
	 padding: '10px'
	 } });
	 }); */

	$(function() {

		$('.tooltip').qtip({
			position : {
				my : 'bottom left',
				at : 'top center',
				viewport : $(window)
			// ...and make sure it stays on-screen if possib
			},
			title : {
				text : 'My ',
				button : true

			},
			style : {
				tip : {
					corner : true
				},
				classes : 'ui-tooltip-shadow ui-tooltip-blue'
			}
		});

	});
</script>
<!-- ${pageContext.request.contextPath}/ -->
<div id="container" dir='<spring:message code="page.dir"/>'
	align='<spring:message code="page.align"/>'>
	<!--<form action="j_security_check"
		method="POST" id="Login" name="Login">

		-->
		

		<form:form name="Login" id="Login" method="POST" modelAttribute="<%=ConstantsAdmin.LOGIN_MODEL_KEY %>" >
		
		
		<c:if test="${param.error != null}">
			<script type="text/javascript">
				$(document)
						.ready(
								function() {
									jAlert(
											'error',
											'<spring:message code="error.login.unsuccess" />.<br/><spring:message code="error.login.unsuccess.reason" />: <c:out value="${SPRING_SECURITY_LAST_EXCEPTION.message}"/>',
											'<spring:message code="label.errormessage" />');
								});
			</script>
		</c:if>
		<spring:hasBindErrors	name="<%=ConstantsAdmin.LOGIN_MODEL_KEY %>">
			<script type="text/javascript">
				$(document).ready(
						function() {
							jAlert('error', '<li><form:errors path="*" delimiter="<li>"/>',
									'<spring:message code="label.errormessage" />');
						});
			</script>
		</spring:hasBindErrors>

		<fieldset>
			<legend>
				<spring:message code="label.client.login" />
			</legend>
				<div class="t_fin-black-txt">
					<div><spring:message code="label.login.message" />
					<a href="register/newclient/form.htm"> <spring:message
							code="label.login.clickhere" /> </a> <img class="tooltip"
						src='<c:url value="resources/images/question.png"/>'
						id="click_here"
						title="<spring:message code="title.client.tksid.pin" />">
					</div><br/>
				<div class="t_form-left">
				<div>
					<label for="strUserName"> <span class="t_star">*</span><spring:message
							code="label.client.username" /> </label> 
							
							<form:input path="strUserName" id="strUserName" size="30" maxlength="30"/><!--
							
							<input type='text'
						id='j_username' name='j_username' size="30" maxlength="100" class="t_form-fld"/>

				--></div>
				<div>
					<label for="strPassword">
					<span class="t_star">*</span>
					 <spring:message code="label.client.password" /> </label>
					<form:password path="strPassword" id="strPassword" size="30" maxlength="30"/><!--
				    <input type="password"	id='j_password' name='j_password' size="30" maxlength="100" class="t_form-fld"/>
				--></div>
				</div>
<%-- 				<div>
					<span>
					<spring:message
								code="client.remember.password" />
					<img class="tooltip"
						src='<c:url value="resources/images/question.png"/>'
						title="<spring:message code="title.remember.password" />">
					<input type="checkbox" name="_spring_security_remember_me"
						id="_spring_security_remember_me">
					</span> 
				</div>
--%>
				<div id="fm-submit">
						<input type="submit" name="submit"
						value="<spring:message code="label.button.submit" />"  class="t_btns submit" />
				</div>

				<div style="clear:both;">
					<a href="register/password/form.htm"> <spring:message
							code="client.forgot.password" /> </a> <img class="tooltip"
						src='<c:url value="resources/images/question.png"/>'
						title="<spring:message code="title.forgot.password" />"> <br />
					<a href="register/inquirestatus/form.htm"> <spring:message
							code="client.inquire.status" /> </a> <img class="tooltip"
						src='<c:url value="resources/images/question.png"/>'
						title="<spring:message code="title.inquire.status" />"> <br />

					<a href="register/recallpin/form.htm"> <spring:message
							code="client.recall.pin" /> </a> <img class="tooltip"
						src='<c:url value="resources/images/question.png"/>'
						title="<spring:message code="title.recall.pin" />"> <br />
				</div>
				
<!--				<div class="t_btn-container">-->
<!--					<a href="javascript:document.forms[0].submit()" class="t_btns" target="_self">-->
<!--						<img src='<c:url value="resources/images/common/submit_btn.png"/>'-->
<!--						alt="<spring:message code="label.button.submit" />"> </a>-->
<!--				</div>-->
			</div>
		</fieldset>
	<!--</form>-->
	</form:form>
	
</div>